package com.qidian.tcba.admin.api.controller;


import com.qidian.tcba.admin.model.dto.parkLot.ParkLotInfoDTO;
import com.qidian.tcba.admin.model.dto.parkLotSite.ParkLotSiteDTO;
import com.qidian.tcba.admin.service.ParkLotSiteSurveyService;
import com.qidian.tcba.utils.JSONResult;
import com.qidian.tcba.utils.Message;
import com.qidian.tcba.utils.result.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 现场勘察情况表 前端控制器
 * </p>
 *
 * @author 冯永龙
 * @since 2021-07-06
 */
@RestController
@RequestMapping("/parkLotSiteSurvey")
@Api(tags = "现场勘察模板")
public class ParkLotSiteSurveyController {

    private final ParkLotSiteSurveyService parkLotSiteSurveyService;

    public ParkLotSiteSurveyController(ParkLotSiteSurveyService parkLotSiteSurveyService) {
        this.parkLotSiteSurveyService = parkLotSiteSurveyService;
    }

    @ApiOperation("获取所有勘察模板")
    @GetMapping("/getAll")
    public JSONResult<List<ParkLotSiteDTO>> getAllSiteInfo(){
        List<ParkLotSiteDTO> parkLotAllSiteInfo = parkLotSiteSurveyService.getParkLotAllSiteInfo();
        return new JSONResult<>(parkLotAllSiteInfo,new Message("DB.SELECT_SUCCESS"));
    }
}

